package ua.kharkov.knure.dereza.summarytask4.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;

/**
 * Application Lifecycle Listener.
 *
 */
public class LifeCycleListener implements ServletContextListener {
	
	private static final Logger log = Logger.getLogger(LifeCycleListener.class);

    public void contextInitialized(ServletContextEvent arg0) {
    	log.info("Application started");
    	
    	try {
			Class.forName("ua.kharkov.knure.dereza.summarytask4.command.CommandContainer");
		} catch (ClassNotFoundException e) {
			log.error("Class of command container not found", e);
		}
    }

    public void contextDestroyed(ServletContextEvent arg0) {
    	log.info("Application stopped");
    }	
}